{% extends "admin/change_list.html" %}
{% load adminmedia admin_list graph_tags i18n %}

{% block extrastyle %}
  {{ block.super }}
  
  {% if cl.formset %}
  
  {% endif %}
  {% if cl.formset or action_form %}
    {% url admin:jsi18n as jsi18nurl %}
    <script type="text/javascript" src="{{ jsi18nurl|default:'../../jsi18n/' }}"></script>
  {% endif %}
  {{ media.css }}
  <style type="text/css">
  {% if not actions_on_top and not actions_on_bottom %}
      #changelist table thead th:first-child {width: inherit}
  {% endif %}
    /* Property list photos custom */
    .media > ul.thumbnails {
      margin-bottom: 0;
      margin-top: 0;
    }
    .media [class*="span"] {
      margin-left: 0;
    }

    /* This is custom for tooltip photos of realtor */
    [rel="tooltip"]:hover {
      cursor: pointer;
    }
    .tooltip-inner ul.thumbnails {
      margin-right: 10px;
    }
    .tooltip-inner ul.thumbnails li {
      margin: 0;
    }
  </style>
  {% if cl.has_filters %}
  {% endif %}
{% endblock %}

{% block extrahead %}
{{ block.super }}
{{ media.js }}
 <script type="text/javascript">
  (function($){
    $(document).ready(function(){
      $('#changelist-form').tooltip({
        selector: "[rel=tooltip]",
        container: 'body',
        placement:'in top'
      });
      $('#changelist-form').tooltip('show')
    });
  })(jQuery);
 </script>
{% if cl.has_filters %}

{% endif %}
{% if action_form %}{% if actions_on_top or actions_on_bottom %}
<script type="text/javascript">
(function($) {
    $(document).ready(function($) {
        $("tr input.action-select").actions();
    });
})(django.jQuery);
</script>
{% endif %}{% endif %}
{% endblock %}

{% block bodyclass %}change-list{% endblock %}

{% if not is_popup %}
  {% block breadcrumbs %}
    <ul class="breadcrumb">
      <li><a href="{% url admin:index %}"><i class="icon-home" ></i>{% trans "Home" %}</a> <span class="divider">/</span></li>
      <li class="active">{{ cl.opts.verbose_name_plural|capfirst }}</li>
    </ul>
  {% endblock %}
{% endif %}

{% block coltype %}flex{% endblock %}

{% block content_title %}
  {% if title %}<h4 class="span8">{{ title }}</h4>{% endif %}
  {% if has_add_permission %}
  <div class="offset7 text-right">
    <div class="btn-group">
      <a title="{% blocktrans with cl.opts.verbose_name as name %}Add {{ name }}{% endblocktrans %}" 
         {% if is_popup %} href="add/?_popup=1" {% else %} href="add/" {% endif %} 
         class="btn btn-primary">
        <i class="icon-plus icon-white"></i>
        {% if not is_popup %}
          {% blocktrans with cl.opts.verbose_name as name %}{{ name }}{% endblocktrans %}
        {% else %}
          {% blocktrans %}Add{% endblocktrans %}
        {% endif %}
      </a>
    </div>
  </div>
  {% endif %}
{% endblock %}

{% block content %}
        <div class="row-fluid">
          <div class="span9">
              {% block object-tools %}{% endblock %}
              {% if cl.formset.errors %}
                  <div class="alert alert-error">
                  {% blocktrans count cl.formset.errors|length as counter %}Please correct the error below.{% plural %}Please correct the errors below.{% endblocktrans %}
                  </div>
                  {{ cl.formset.non_form_errors }}
              {% endif %}
              <div class="widget-header-no-hieght">
                {% block search %}{% search_form cl %}{% endblock %}
              </div>
              <div class="widget-header-no-hieght visible-desktop">
                {% block date_hierarchy %}{% date_hierarchy cl %}{% endblock %}
              </div>
              <form id="changelist-form" action="" method="post"{% if cl.formset.is_multipart %} enctype="multipart/form-data"{% endif %}>{% csrf_token %}
                {% if is_popup %}<input type="hidden" name="_popup" value="1" />{% endif %}
                {% if cl.formset %}
                  {{ cl.formset.management_form }}
                {% endif %}
                <div class="widget widget-table">          
                {% block result_list %}
                    <div class="widget-header-no-hieght">
                    {% if action_form and actions_on_top and cl.full_result_count %}{% admin_actions %}{% endif %}
                    </div>
                    <div class="widget-content">
                    {% include "admin/newspapers/news/change_list_results.html" %}
                    {% if action_form and actions_on_bottom and cl.full_result_count %}{% admin_actions %}{% endif %}
                    </div>
                {% endblock %}
                {% block pagination %}{% pagination cl %}{% endblock %}
                </div>
              </form>
              
          </div>
          
          {% block filters %}

              {% if cl.has_filters %}
                <div class="span3 container real_apps">
                  <div class="nav-collapse collapse visible-desktop">
                    <div class="widget">
                        <div class="widget-header">
                          <i class="icon-filter"></i><h3 id="filter">{% trans 'Filter' %}</h3>
                        </div>
                        <div id="changelist-filter-content" class="widget-content">
                          {% for spec in cl.filter_specs %}{% admin_list_filter cl spec %}{% endfor %}
                        </div>
                    </div>
                  </div>
                </div>
              {% endif %}

          {% endblock %}
        </div>
{% endblock %}